﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace ThisIsFirstTest.Models.AccountModel
{
    public class LogOnModel
    {
        [Required]
        [AllowHtml]
        [RegularExpression("(^([\u4e00-\u9fa5]+|[a-zA-Z0-9]+)$){1,16}", ErrorMessage = "only letter and number, length is 2-16.")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [RegularExpression("([a-zA-Z0-9]){4,16}", ErrorMessage = "only letter and number, length is 4-16.")]
        public string Password { get; set; }

        public bool RememberMe { get; set; }
    }
    public class RegisterNewAccountModel
    {
        [Required]
        //[Display(Name = "User name")]
        [AllowHtml]
        [RegularExpression("(^([\u4e00-\u9fa5]+|[a-zA-Z0-9]+)$){1,16}", ErrorMessage = "only letter and number, length is 2-16.")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [RegularExpression("([a-zA-Z0-9]){4,16}", ErrorMessage = "only letter and number, length is 4-16.")]
        public string Password { get; set; }

        //[Display(Name = "E-mail")]
        //[RegularExpression("^[a-z0-9_\\+-]+(\\.[a-z0-9_\\+-]+)*@[a-z0-9-]+)*\\.([z-z]{2,4})$", ErrorMessage = "Not Valid Email.")]
        public string EmailAddress { get; set; }
    }
    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [MaxLength(16, ErrorMessage = "Max Length is 16.")]
        public string Password { get; set; }
        [Required]
        [DataType(DataType.Password)]
        [MaxLength(16, ErrorMessage = "Max Length is 16.")]
        public string NewPassword { get; set; }
    }
}